{layout name="./base/base_back"}
		<link rel="stylesheet" type="text/css" href="/front/css/myhomepage.css"/>
		<script src="/front/js/jquery.js"></script>
		<script src="/front/js/index.js"></script>

		<!--首页开始-->
		<div id="my-homepage-box">
			<div id="my-homepage">
				{include file="./navleft"}
				<div class="my-homepage-right">
					<div class="my-homepage-info">
						<div class="my-homepage-tit">
							<div class="my-homepage-headimg">
								<img src="{$userinfo.head}" alt="" />
							</div>
							<p class="my-homepage-account">账号：{$userinfo.mobile}</p>
							<p class="my-homepage-coin">我的双辉币: <i>{$userinfo.integral}</i></p>
						</div>

						<div class="my-homepage-aboutusinfo">
							<ul>
								<li><a href="###"><img src="/front/img/hp1.png" alt="" /><p>待付款<i>{$order_d_f}</i></p></a></li>
								<li><a href="###"><img src="/front/img/hp2.png" alt="" /><p>待入住<i>{$order_d_r}</i></p></a></li>
								<li><a href="###"><img src="/front/img/hp3.png" alt="" /><p>我的需求<i>{$wish_num}</i></p></a></li>
								<li><a href="###"><img src="/front/img/hp4.png" alt="" /><p>我的抢单<i>{$wish_q_d}</i></p></a></li>
								<li><a href="###"><img src="/front/img/hp5.png" alt="" /><p>我的消息<i>{$message_num}</i></p></a></li>
							</ul>
						</div>
					</div>
					
					<div class="my-homepage-order">
						<div class="my-homepage-order-tit">
							<span><img src="/front/img/or1.png" alt="" />最近订单</span>
							<!-- <a href="###">查看全部>></a> -->
						</div>
						<!--最近开始-->
						<div class="recent-caravan-order-list-group" style="">
						{volist name='list' id='vo'}
							<div class="recent-caravan-order-group-tit">
								<span>订单编号：<i>{$vo.number}</i></span>
								<span>下单时间：<i>{$vo.created_at}</i></span>
								<span class="recent-caravan-order-group-state">[{$vo.status}]</span>
								{if $vo.status == '未支付'}
								<span>请在<i style="padding: 0px 0px;"><span id="{$vo.id}"><?php echo strtotime($vo['created_at'])+3600-time()?></span></i>内完成支付</span>
								{else/}
								{/if}
								<span class="recent-caravan-order-group-service">营地客服：<img src="/front/img/lx.png" alt="" /></span>

							</div>
							<div class="recent-caravan-order-group-cont">
								<ul>
									<li class="caravan-img">
									{if !empty($vo['caravan']['caravancover'][0])}
									<img src={$vo.caravan.caravancover[0]} alt="" />
									{/if}
									</li>
									<li class="recent-caravan-order-li-1">
										<p>房车名称（<i>{$vo.caravan.name}</i>）</p>
										<p>{$vo.caravan.carcates.name}</p>
										<p class="caravan-order-camp">营地服务机构名称:<a href="#">（<i>{$vo.camp.name}</i>）</a></p>
										<p>入住：<i>{$vo.take_car_date}</i></p>
										<p>离开：<i>{$vo.leave_car_date}</i></p>
									</li>
									<li class="recent-caravan-order-li-2">
										<p class="need-pay" style="display: none;">需支付</p>
										<p class="need-pay">在线支付</p>
										{if $vo.source == '1'}
										<p>旅行币 {$vo.total_intergral}</p>
										<p>押金 <i>¥</i>{$vo.deposit}</p>
										{else/}
										<p>现金 <i>¥</i>{$vo.total_amount}</p>
										<p>押金 <i>¥</i>{$vo.deposit}</p>
										{/if}
									</li>
									<!-- <li class="recent-caravan-order-li-3">
										<img src="/front/img/appcar.png" alt="" />
										<p>验证编码：1212151</p>
									</li> -->
									{if $vo.status == '未支付'}
									<li class="recent-caravan-order-li-4">
										<p><a href="/order/payorder?order_id={$vo.number}">马上支付</a></p>
										<p><a id="can" onclick="can({$vo.number})" style="background:#ccc;">取消订单</a></p>
									</li>
									{elseif $vo.status == '支付中'}
									<li class="recent-caravan-order-li-4">
										<p><a href="/order/payorder?order_id={$vo.number}">继续支付</a></p>
										<p><a id="oncel" onclick="oncel({$vo.number})" style="background:#ccc;">取消订单</a></p>
									</li>
									{elseif $vo.status == '待入住'}
									<li class="recent-caravan-order-li-4">
										<p><a href="/order/orderdetail?id={$vo.id}">查看详情</a></p>
										<p><a id="cel" onclick="cel({$vo.number})" style="background:#ccc;">取消订单</a></p>
									</li>
									{elseif $vo.status == '入住中'}
									<li class="recent-caravan-order-li-4">
										<p><a href="/order/orderdetail?id={$vo.id}">查看详情</a></p>
									</li>
									{elseif $vo.status == '已完成'}
									<li class="recent-caravan-order-li-4">
										<p><a href="/order/orderdetail?id={$vo.id}">查看详情</a></p>
										<p><a href="###">投诉建议</a></p>
									</li>
									{else}
									<li class="recent-caravan-order-li-4">
										<p><a href="/order/orderdetail?id={$vo.id}">查看详情</a></p>
										<!-- <p><a href="###">重新下单</a></p> -->
									</li>
									{/if}

								</ul>
							</div>

							<script type="text/javascript">
								function getLocalTime(t) {
									h=Math.floor(t/60/60%24);
								    m=Math.floor(t/60%60);
								    s=Math.floor(t%60);
									return h+'小时'+m+'分'+s+'秒';
								}
								$('#{$vo.id}').each(function(){
									var btn = $(this);
									var count = btn.text();
							    	var time = parseInt(count);
								    var resend = setInterval(function(){
								        count--;
								        if (count >=-1){
								            btn.html(getLocalTime(time--));
								        }else {
								        	btn.html(0);
								        	$('#{$vo.id}').each(function(){
												if($(this).text()<=0){
													$(this).parent('tr').hide();
									            	var data = $(this).siblings('input').val();
									            	$.ajax({
									            		type:"get",
									            		url:"/wishs/cancelorder",
									            		data:{id:data},
									            	});
									            }
											})
								            clearInterval(resend);
								        }
								    }, 1000);
								})
							</script>
							{/volist}
							<!--未支付取消订单提示框开始-->
								<div id="shsy-coin-bounced-box5" class="shsy-coin-bounced-box" style="display:none;">
									<div class="shsy-coin-bounced-bg"></div>
									<div id="shsy-coin-bounced">
										<div class="shsy-bounced-info">
											<div class="shsy-prompt-title">
												<p class="shsy-prompt">温馨提示</p>
												<p class="shsy-close">关闭</p>
											</div>
											<div class="shsy-prompt-cont">
												<dd>您的订单还未支付,确认取消订单吗？</dd>
											</div>
											<div class="shsy-prompt-over">
												<a id="true" href="">确定</a>
											</div>
										</div>
									</div>
								</div>
							<!--未支付取消订单提示框结束-->
							<!-- 触发弹出框开始-->
								<script type="text/javascript">
									function can(id){
										$('#true').attr('href','/order/cancelorder?id='+id);
										$('#shsy-coin-bounced-box5').show();
									}
									$(function(){
										$(".shsy-close").click(function(){
											$('#shsy-coin-bounced-box5').hide();
										})
									})
								</script>
							<!-- 触发弹出框结束	 -->

							<!--支付中取消订单提示框开始-->
								<div id="shsy-coin-bounced-box7" class="shsy-coin-bounced-box" style="display:none;">
									<div class="shsy-coin-bounced-bg"></div>
									<div id="shsy-coin-bounced">
										<div class="shsy-bounced-info">
											<div class="shsy-prompt-title">
												<p class="shsy-prompt">温馨提示</p>
												<p class="shsy-close">关闭</p>
											</div>
											<div class="shsy-prompt-cont">
												<dd>您的订单还未支付,确认取消订单吗？</dd>
											</div>
											<div class="shsy-prompt-over">
												<a id="true2" href="">确定</a>
											</div>
										</div>
									</div>
								</div>
							<!--未支付取消订单提示框结束-->
							<!-- 触发弹出框开始-->
								<script type="text/javascript">
									function oncel(id){
										$('#true2').attr('href','/order/cancelorder?id='+id);
										$('#shsy-coin-bounced-box7').show();
									}
									$(function(){
										$(".shsy-close").click(function(){
											$('#shsy-coin-bounced-box7').hide();
										})
									})
								</script>
							<!-- 触发弹出框结束	 -->

							<!--已支付取消订单提示框开始-->
								<div id="shsy-coin-bounced-box6" class="shsy-coin-bounced-box" style="display:none;">
									<div class="shsy-coin-bounced-bg"></div>
									<div id="shsy-coin-bounced">
										<div class="shsy-bounced-info">
											<div class="shsy-prompt-title">
												<p class="shsy-prompt">温馨提示</p>
												<p class="shsy-close">关闭</p>
											</div>
											<div class="shsy-prompt-cont">
												<dt>取消订单规则及惩罚措施</dt>
												<dd>1. 入住前7天外取消订单，不扣除任何费用。</dd>
												<dd>2. 入住前7天内取消订单，将扣除本订单旅行币的50%。</dd>
												<dd>确定要取消订单吗？</dd>
											</div>
											<div class="shsy-prompt-over">
												<a id="ture1" href="">确定</a>
											</div>
										</div>
									</div>
								</div>
								
							<!--已支付取消订单提示框结束-->
							<!-- 触发弹出框开始-->
								<script type="text/javascript">
									function cel(id){
										$('#true1').attr('href','/order/cancelorder?id='+id);
										$('#shsy-coin-bounced-box6').show();
									}
									$(function(){
										$(".shsy-close").click(function(){
											$('#shsy-coin-bounced-box6').hide();
										})
									})
								</script>
							<!-- 触发弹出框结束	 -->
						
						</div>
						<!--最近结束-->
						{$list->render()}
						<div class="recent-caravan-no-order">
							<p>最近没有预约订单哦 !</p>
							<p><a href="/setcaravan/rentcaravan">马上去交换</a><a href="/setcaravan/sharecaravan">马上去分享</a></p>
						</div>
					</div>
				</div>
			</div>
		</div>
		<!--实名认证结束-->
